package top.hjcwzx.wrench.dynamic.config.center.config;

import org.apache.commons.lang.StringUtils;
import org.springframework.boot.context.properties.ConfigurationProperties;
import top.hjcwzx.wrench.dynamic.config.center.types.common.Constants;

import java.util.UUID;


@ConfigurationProperties(prefix = "wrench-kit.config", ignoreInvalidFields = true)
public class DynamicConfigCenterAutoProperties {

    /**
     * 系统
     */
    private String system;


    public String getKey(String attributeName) {
        if(StringUtils.isEmpty(this.system)){
            this.system  = UUID.randomUUID().toString().substring(6);
        }

        return this.system + Constants.LINE + attributeName;
    }

    public String getSystem() {
        return system;
    }

    public void setSystem(String system) {
        this.system = system;
    }
}
